function [stat]=filtercorrelations(corrplanes, originalplanes)
    for i=1:length(corrplanes)
        corrplanes{i}=corrplanes{i}/norm(corrplanes{i});
    end
    for i=1:length(originalplanes)
        originalplanes{i}=originalplanes{i}/norm(originalplanes{i});
    end
    stat=zero(1,length(originalplanes);
    for i=1:length(corrplanes)
        plane=corrplanes{i};
        for j=1:length(originalplanes)
            if compareplanes(plane,originalplanes{j})==1
                stat[j]=1;
            end
        end
    end
end

function [ret]=compareplanes(plane1,plane2, r)
    if length(plane1)!=length(plane2)
        ret=0;
        return;
    end
    for i=1:length(plane1)-1
        if abs(plane1(i)-plane2(i)) > r
            ret=0;
            return;
        end
    end
    ret=1;
end
